﻿<!-- Start Left Column -->
<div class="onethird-column">
    <h2><span>Category</span></h2>
    <ul id="blogCategory" style="margin-left: 20px; font-size: 10pt">
    </ul>
    
    <h2><span>Date</span></h2>
    <div id="blogcalendar"></div>
</div>
<!-- End Left Column -->

<!-- Start Right Column -->
<div class="twothird-column">
    <h2><span>Blogs</span></h2>

    <div class="clear"></div>
    <span id="loading" class="nhanloading"></span>
    <div id="bloglist"></div>

</div>

<script>
    $(document).ready(function() {
        var cat = new BlogCategory();
        cat.getCategories(function (back) {
            var str = "";
            $('#blogCategory').html("");
            $.each(back, function(i, item) {
                str = "<li style='margin-bottom: 10px'><a href='' title='"+item.Description+"'><strong>" + item.CategoryName + "</strong></a></li>";
                $('#blogCategory').append(str);
            });
        });
        
        var post = new BlogPost();
        post.getPosts(function (back) {
            var str = "";
            $('#bloglist').html("");
            $.each(back, function (i, item) {
                str = "<span><a href='' title='" + item.Description + "'><strong>" + item.Title + "</strong></a></span>";
                //str = "<span><a href='' title='" + item.Description + "'><strong>" + item.Title + "</strong></a></span> - <span style='font-style: italic'>" + item.DateCreated + "</span>";
                str += "<p>" + item.Description + "</p>";
                $('#bloglist').append(str);
                //$('#loading').removeClass('nhanloading');
            });
        });
    });     

 </script>